package com.gimi.cloud.bbp.dao.dao.prod;

import com.gimi.cloud.bbp.dao.dao.sys.BaseDao;
import com.gimi.cloud.bbp.dao.myMapper.MyMapper;
import com.gimi.cloud.bbp.dto.prod.EcProdBrandDTO;
import com.gimi.cloud.bbp.entity.prod.EcProdBrandEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* 品牌管理界面
* @author lixj
* @Description
* @create 2017-12-18
* @version 1.0
**/
@Mapper
public interface EcProdBrandDao extends MyMapper<EcProdBrandEntity>,BaseDao<EcProdBrandEntity,EcProdBrandDTO> {
    /**
     * 根据品类ID查询对应的品牌
     * @param prodCatId
     * @turn
     */
    @Select("SELECT pd_id,prod_brand_name from ec_prod_brand where type = 1 AND pd_id in(SELECT prod_brand_id from ec_category_brand_rela where prod_cat_id = #{prodCatId}) ")
    List<EcProdBrandDTO> getCatBrands(@Param("prodCatId") String prodCatId);
}
